<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>校园综合服务系统</title>
    <head>
        <script src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.8.0.js"></script>
        <script>
            $(document).ready(function(){
                var urlParams = new URLSearchParams(window.location.search);

                var id = urlParams.get('id');
                $.get("http://localhost/blog/view-blog", {id: id}, function(response) {
                    var rs = $.parseJSON(response)
                    if (rs.code != "00000") {
                        alert("查看帖子失败")
                    }
                    $("div.container").append("<p>" + rs.data.title + "</p>")
                    $("div.container").append("<p>作者：" + rs.data.author_realname + "</p>")
                    $("div.container").append("<p>发布时间：" + rs.data.publish_time + "</p>")    
                    $("div.container").append("<p>" + rs.data.content + "</p>")
                });
            });
        </script>
        </head>
    <style>
        .container {
            text-align: center;
        }
    </style>
</head>
<body>
    
    <a href="">我的课程</a><br>
    <a href="">选课</a><br>
    <a href="">校园论坛</a><br>
    <a href="">修改密码</a><br>
    <div class="container">    
        
    </div>
    


</body>
</html>